home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 029a / fdate44.zip / FDATE.DOC < prev    next >
Text File  |  1992-01-21  |  48KB  |  1,222 lines

  1. FDATE      Version 4.4a                          Jan 20, 1992
  2. ===================================================================
  3. FDATE: a utility for date manipulation in batch files.
  4. ===================================================================
  5. Stephen Ferg             5113 N. 8th Road, Arlington, VA 22205-1201
  6. Voice (703) 525-2241     CompuServe 73377,1157
  7.  
  8. =======================================================================
  9. Format:
  10. FDATE /Ffunc /Adate /Bdate /Iformat /Oformat
  11.              /Nnum /Ddayofweek /Pstring /Sstring
  12. =======================================================================
  13.  
  14.  
  15. FDATE PARAMETERS
  16. ================
  17.  
  18. The parameters that are required depend on the function requested.
  19. Parameters that are specified, but not needed, are ignored.
  20. Executing FDATE without any parameters displays a brief help screen.
  21.  
  22. Parameters can be in any order and upper or lower case.
  23.      Note that although format specifications are not case sensitive,
  24.      they ARE "text sensitive".  If any characters are missing,
  25.      added, or mistyped, the format specification will be rejected.
  26.      (A common mistake is to enter "/format" instead of "/Fformat".
  27.       This mistake can be avoided by using the /Ff function alias.)
  28.  
  29.  /F  requests a particular FDATE function
  30.      If this parameter is not specified, or is specified incorrectly,
  31.      FDATE displays a help screen.  If you unexpectedly get the help
  32.      screen displayed, you probably have omitted the /F parameter.
  33.  
  34.  /N  number of days (always a number)
  35.  
  36.  
  37.  /A  date A  (for date functions)
  38.  /B  date B  (for date functions)
  39.      If the /A parameter is omitted, /Atoday is assumed.
  40.      If the /B parameter is omitted, /Btoday is assumed.
  41.  
  42.  /A  number A  (for math functions)
  43.  /B  number B  (for math functions)
  44.  
  45.  /I  specifies format of input date(s)
  46.      If the /I parameter is omitted, /Imm-dd-ccyy is assumed.
  47.  
  48.  /O  specifies format of output date
  49.      If the /O parameter is omitted, /Od1 is assumed.
  50.  
  51.  /L  specifies language of output.
  52.      /Leng  English-language output
  53.      /Lfr   French-language output
  54.      If the /L parameter is omitted, /Leng [English] is assumed.
  55.  
  56.  /P  specifies a prefix string for the output
  57.  /S  specifies a suffix string for the output
  58.      Maximum length for a prefix or suffix string is 80 bytes.
  59.      These optional parameters may always be specified or omitted.
  60.      They must be enclosed in single quotes, double quotes, or
  61.                   square brackets
  62.  
  63.      Note that "whitespace" will be removed from these strings,
  64.      so formatting of /P and /S strings cannot be controlled using
  65.      spaces.  To format strings, use periods or ASCII 255 (hex'ff')
  66.      as filler.
  67.  
  68.      EXAMPLES
  69.      FDATE /Ff   /At /Od1         /P"Today is "
  70.      FDATE /Fdif /At /B12-25-TTTT /S" days until Christmas"
  71.      FDATE /Fdif /At /B12-25-TTTT /P"It is " /S" days 'til Xmas"
  72.      FDATE /Ff       /A05-08-TTTT /S[ -- "Buffalo Bill's" birthday]
  73.  
  74.  
  75.  
  76. ERROR HANDLING
  77. ==============
  78.  
  79.    If FDATE detects an error:
  80.  
  81.      (1) it will return an errorlevel of 1 (rather than 0), and
  82.      (2) its output will be 3 lines:
  83.        * the word ERROR
  84.        * a DOS batch-file ECHO statement that displays an error message
  85.        * a DOS batch-file PAUSE statement
  86.  
  87.    If Fdate output is displayed directly, or redirected to NUL:
  88.    you can detect an error by testing the errorlevel for a value of 1.
  89.  
  90.    If Fdate output is piped to an environment manipulation utility such
  91.    as STRINGS or GET, the environment variable will be set to ERROR.
  92.    Errorlevel will be set by STRINGS/GET, and will probably be 0.
  93.    In such a case, the only way to detect an error is to test the
  94.    environment variable for the value ERROR.
  95.  
  96.    If FDATE output is redirected to a batch file, which is then
  97.    CALLed to set an environment variable, the batch file will:
  98.      * set the environment variable to ERROR,
  99.      * ECHO the error message, and
  100.      * pause.
  101.    You can detect an error by testing errorlevel for the value 1
  102.    either before or after you CALL the batch file.
  103.    You can detect an error by testing the environment variable for the
  104.    value ERROR, AFTER you have CALLed the batch file.
  105.  
  106. ----------------------------------------------------------------------
  107.  
  108.  EXAMPLE:
  109.    rem use FDATE to check validity of year in parm %1
  110.    Fdate /Ff /Imm-dd-ccyy /ATT-TT-%1 /Occyy /P"Received year parm: "
  111.    if errorlevel 1 echo Year parm [%1] is not valid.
  112.    if errorlevel 1 goto endit
  113.  
  114.  EXAMPLE:
  115.    rem use FDATE to verify %1, and GET to put it into %year%
  116.    Fdate /Ff /Imm-dd-ccyy /ATT-TT-%1 /Occyy | GET ZE /V%year% >nul
  117.    if (%year%)==(ERROR) echo Year parm [%1] is not valid.
  118.    if (%year%)==(ERROR) goto endit
  119.  
  120.  EXAMPLE:
  121.    rem use FDATE to verify %1, call a batch file to put it into %year%
  122.    Fdate /Ff /Imm-dd-ccyy /ATT-TT-%1 /Occyy /P"@set year=">junktemp.bat
  123.    call junktemp.bat
  124.    del  junktemp.bat
  125.    if errorlevel 1 echo Year parm [%1] is not valid.
  126.    if errorlevel 1 goto endit
  127.  
  128. SYMBOL CONVENTIONS
  129. ==================
  130.  
  131. The following symbols are used in specifying date formats:
  132.  
  133. SYMBOL  EXAMPLE   MEANING
  134. ------  -------   -------------------------------------
  135. cc        19      century
  136. yy        93      year
  137. mm        02      month
  138. zm         2      month without leading zero
  139. dd        08      day
  140. zd         8      day   without leading zero
  141. mn       February month name
  142. mn3      Feb      month name, first 3 characters only
  143. dow      Tuesday  day of week
  144. dow3     Tue      day of week, first 3 characters only
  145. dow#      3       day of week as a number (Sunday=1, Monday = 2, etc.)
  146. today             is a "pseudodate" representing the current date
  147. t                 is an alias for the "today" pseudodate
  148. hh:mm    09:05    hours and minutes
  149. hhmm     0905     hours and minutes
  150. ss        09      seconds
  151.  
  152.  
  153.  
  154. PSEUDODATES
  155. ===========
  156.  
  157. t (or today)
  158.           can be used with either /A or /B, e.g. /Atoday or /At.
  159.  
  160. EXAMPLE
  161.           rem Get the date that is 90 days from today
  162.           FDATE /Fadd /N90 /Atoday /Omm-dd-ccyy
  163.           FDATE /Fadd /N90 /At     /Omm-dd-ccyy
  164.  
  165.           rem determine if this year is a leapyear
  166.           FDATE /Ff /At /OLY
  167.  
  168. tt        when used in place of a 2-digit DD string, will cause
  169.           Fdate to use today's day-of-the-month.
  170.           Example:    FDATE /Ff /Imm-dd-ccyy /A01-tt-1992 /Od1
  171.  
  172. tt        when used in place of a 2-digit MM string, will cause
  173.           Fdate to use today's month.
  174.           Example:    FDATE /Ff /Imm-dd-ccyy /Att-01-1992 /Od1
  175.  
  176. tt        when used in place of a 2-digit YY string, will cause
  177.           Fdate to use today's year (CCYY).
  178.           Example:    FDATE /Ff /Imm-dd-yy /A01-01-tt /Od1
  179.  
  180.           Note that TT can NOT be used for only the YY part of a CCYY
  181.           input year.  The following, for example, is NOT valid:
  182.           Example:    FDATE /Ff /Imm-dd-ccyy /A01-01-19tt /Od1
  183.  
  184. tttt      when used in place of a 4-digit CCYY string, will cause
  185.           Fdate to use today's year (CCYY).
  186.           Example:    FDATE /Ff /Imm-dd-ccyy /A01-01-tttt /Od1
  187.  
  188.  
  189. EXAMPLES:
  190.  
  191. Show the first Monday in the second quarter of this year
  192. FDATE /Fw /Iccyymmdd /Atttt0301 /D2 /N1 /Od1 /P"First Monday in QTR#2: "
  193.  
  194. Show the last Friday on/before the 15th of this month.
  195. FDATE /Fw /Iccyymmdd /Atttttt15 /D6 /N-1 /Od1 /P"Friday before the 15th: "
  196.  
  197.  
  198. INPUT FORMATS
  199. =============
  200.  
  201. FORMAT      EXAMPLES      DISCUSSION
  202. ------      ---------     -----------------------------
  203. ccyymmdd    19922002
  204.  
  205. mm-dd-ccyy  02-20-1992    In an input format specification, the dash
  206.             02/20/1992    symbols represent ANY non-numeric symbol.
  207.              2/20/1992    Leading zeros need not be present.
  208.  
  209. mm-dd-yy    02-20-92      In this input format,
  210.             02/20/92      cc=19 is assumed if YY is greater than 20
  211.             02/20/92      otherwise, cc=20 is assumed
  212.  
  213.  
  214. NOTE
  215. If ALL input dates are specified using the "today" pseudodate, (i.e.
  216. /At, /Bt) then it is not necessary to supply an input format using /I.
  217.  
  218.  
  219.  
  220.  
  221. OUTPUT FORMATS
  222. ==============
  223.  
  224. FORMAT        EXAMPLES      DISCUSSION
  225. ------        ---------     -----------------------------
  226.  
  227. dd-mn3-yy     08-Feb-92     CompuServe-style date
  228.  
  229. ccyy          1993
  230. ccyymm        199302        useful for triggering monthly processing
  231. ccyymmdd      19930208      useful for putting current date in filename
  232.   yymmdd        908208      useful for putting current date in filename
  233.     mmdd          0208
  234.       dd            08
  235.       zd             8
  236.  
  237. In the following formats, months precede days (American style)
  238. ------------------------------------------------------------------
  239. mm/dd/ccyy    02/08/1993
  240. mm-dd-ccyy    02-08-1993
  241. mm.dd.ccyy    02.08.1993    British-style dates
  242.  
  243. zm/zd/ccyy     2/8/1993     no leading zeros in day or month
  244. zm-zd-ccyy     2-8-1993     no leading zeros in day or month
  245. zm.zd.ccyy     2.8.1993     British-style dates
  246.  
  247. mm/dd/yy      02/08/92
  248. mm-dd-yy      02-08-92
  249. mm.dd.yy      02.08.92      British-style dates
  250.  
  251. zm/zd/yy       2/8/92       no leading zeros in day or month
  252. zm-zd-yy       2-8-92       no leading zeros in day or month
  253. zm.zd.yy       2.8.92       no leading zeros in day or month
  254.  
  255. In the following formats, days precede months  (European style)
  256. ------------------------------------------------------------------
  257. dd/mm/ccyy    02/08/1993
  258. dd-mm-ccyy    02-08-1993
  259. dd.mm.ccyy    02.08.1993    British-style dates
  260.  
  261. zd/zm/ccyy     2/8/1993     no leading zeros in day or month
  262. zd-zm-ccyy     2-8-1993     no leading zeros in day or month
  263. zd.zm.ccyy     2.8.1993     British-style dates
  264.  
  265. dd/mm/yy      02/08/92
  266. dd-mm-yy      02-08-92
  267. dd.mm.yy      02.08.92      British-style dates
  268.  
  269. zd/zm/yy       2/8/92       no leading zeros in day or month
  270. zd-zm-yy       2-8-92       no leading zeros in day or month
  271. zd.zm.yy       2.8.92       British-style dates
  272.  
  273. ------------------------------------------------------------------
  274.  
  275. Day-of-the-week output formats
  276. ------------------------------------------------------------------
  277.  
  278. dow#           5            Sunday=1, Monday=2 .... Saturday=7.
  279.  
  280. dow            Thursday     name of day of week
  281.                Jeudi        if /Lfr specified
  282.  
  283. dow3           Thu          first 3 characters of name of day of week
  284.                Jeu          if /Lfr specified
  285.  
  286. ------------------------------------------------------------------
  287.  
  288.  
  289. LY              0           1 if year is a leapyear, otherwise 0.
  290.                                ------------------------------------
  291.                                365 + this number gives total
  292.                                      number of days in the year.
  293.                                 28 + this number gives total
  294.                                      number of days in February.
  295.                                ------------------------------------
  296.  
  297. d1           Saturday, February 5, 1992
  298.              le Samedi 5 Fevrier 1992      [/Lfr specified]
  299.  
  300. t1            9:05 pm
  301.  
  302. HH:MM        09:05   ("Military time") (9:05 am)
  303.              21:05                     (9:05 pm)
  304.  
  305. HHMM         0905    ("Military time") (9:05 am)
  306.              2105                      (9:05 pm)
  307.  
  308. HH:MM:SS     21:05:30
  309. HHMMSS       210530
  310.  
  311. full          9:05 pm on Saturday, February 5, 1992
  312.               9:05 pm le Samedi 5 Fevrier 1992      [/Lfr specified]
  313. -----------------------------------------------------------------------
  314. NOTE that the following formats contain embedded spaces.  Consequently
  315. they must be enclosed in double quotes. EXAMPLE: /O"mn zd, ccyy".
  316. -----------------------------------------------------------------------
  317. "zd mn ccyy"      5 February 1992
  318. "zd mn, ccyy"     5 February, 1992
  319. "mn3 dd ccyy"     Feb 05 1992
  320. "mn3 dd, ccyy"    Feb 05, 1992
  321. "mn zd, ccyy"     February 5, 1992
  322.  
  323.  
  324.  
  325. "JULIAN" OUTPUT FORMATS
  326. =======================
  327.  
  328. FORMAT        EXAMPLES      DISCUSSION
  329. ------        ---------     -----------------------------
  330.  
  331. julian            311       BUSINESS "Julian date" expressed as number
  332.                             of days since January 1 of the same year.
  333.  
  334. day#           727198       TRUE "Julian date" expressed as number
  335.                             of days since January 1, 0001.
  336.  
  337. minute#         33088       "Julian minutes": time expressed as number
  338.                             of minutes  since midnight, January 1, 1990.
  339.  
  340. second#        633088       "Julian seconds": time expressed as number
  341.                             of seconds  since midnight, January 1, 1990.
  342.  
  343. ----------------------------------------------------------------------
  344.    Running FDATE with /O parameter for a "Julian time" produces a
  345.    number based on the current time of day and the date in the /A parm.
  346.  
  347.    If, on January 10, 1992 at 2 pm, you run FDATE this way:
  348.        FDATE /Ff /Atoday /Ominute#
  349.    it will produce the Julian minute for January 10, 1992 at 2 pm.
  350.  
  351.    If, on January 10, 1992 at 2 pm, you run FDATE this way:
  352.        FDATE /Ff /A01-15-1992 /Imm-dd-ccyy  /Ominute#
  353.    it will produce the Julian minute for January 15, 1992 at 2 pm.
  354. ----------------------------------------------------------------------
  355.  
  356. DATE FUNCTIONS
  357. ==============
  358.  
  359. FUNCTION  FDATE /Ffunc /Adate /Iformat /Oformat
  360. --------  -------------------------------------------
  361. format    this is a synonym for function "f"
  362.  
  363. f         returns /Adate in format specified by /Oformat
  364.           Since /Aformat and /Oformat can be different, the FORMAT
  365.           function is used to change a date from one format to another.
  366.           Because of the wide variety of output formats, the FORMAT
  367.           function can also be used to determine the day of week of the
  368.           date, whether the date is in a normal or leap year, etc.
  369.  
  370. EXAMPLES
  371.           FDATE /Ff /A19920101 /Iccyymmdd /O"mn zd, ccyy"
  372.           FDATE /Ff       /Atoday         /Od1
  373.           FDATE /Fformat  /Atoday         /Od1
  374.  
  375.  
  376.  
  377. FUNCTION  FDATE /Ffunc /Nnumdays /Adate /Iformat /Oformat
  378. --------  -------------------------------------------
  379. add       Adds      /Ndays to   /Adate, produces date in /Oformat format
  380. sub       Subtracts /Ndays from /Adate, produces date in /Oformat format
  381.  
  382. EXAMPLES
  383.           FDATE /Fadd /N90 /A01-01-1992 /Imm-dd-ccyy /Od1
  384.           FDATE /Fsub /N90 /A01-01-1992 /Imm-dd-ccyy /Od1
  385.           FDATE /Fadd /N90 /Atoday                   /Od1
  386.  
  387.  
  388.  
  389. FUNCTION  FDATE /Ffunc /Adate /Bdate /Iformat
  390. --------  -------------------------------------------
  391. comp      compares the dates specified on the /A and /B parms.
  392.           returns         when
  393.             LT            /A  is less than    (earlier than) /B
  394.             EQ            /A  is equal to     (same as)      /B
  395.             GT            /A  is greater than (later than)   /B
  396.  
  397. dif       Returns number of days between /Adate and /Bdate
  398.           Order of the two dates is not significant.
  399.           Note that for DIF, both dates must be in the SAME
  400.           format, the input format specified in /Iformat.
  401.           If the two dates are not in the same format, reformat one
  402.           of the dates using the /Ff function and
  403.           a utility like STRINGS or GET.
  404.  
  405. EXAMPLES
  406.           FDATE /Fdif /A01-01-1992 /B11-11-1992  /Imm-dd-ccyy
  407.           FDATE /Fdif /A11-11-1992 /B01-01-1992  /Imm-dd-ccyy
  408.           FDATE /Fdif /Atoday      /B01-01-1992  /Imm-dd-ccyy
  409.  
  410.  
  411. FUNCTION  FDATE /Ffunc /Adate /Iformat /Oformat /Ddow#  /Ndow-count
  412. --------  -------------------------------------------
  413. w         W (weekday) function.
  414.           This function accepts a date specification in parm /A and
  415.           returns the date of the /Nth /Day-of-the-week
  416.           before or after /Adate.  For example:
  417.  
  418.           If    /A specifies November 14, 1992
  419.                 /D specifies the number for Thursday (i.e., 5)
  420.                 /N specifies a week count of 3
  421.           then /Fw returns the date of the third Thursday after
  422.           November 14, 1992. (See full example, below)
  423.  
  424.           Note that /N may be negative.  If, in the above example, /N
  425.           is specified as -3, then Fdate returns the date of the third
  426.           Thursday BEFORE November 14, 1992.
  427.  
  428.           If the date specified on the /A parms falls on the same day
  429.           of the week as was specified on the /D parm, then that will
  430.           be considered to be the first date meeting that day-of-week
  431.           criterion.  That is, If November 14, 1992 fell on a
  432.           Thursday, and if /N was 1 or -1, then the output date would
  433.           be the same as the input date, i.e.  November 14, 1992.
  434.  
  435.           The acceptable values for /N (number of weeks) is in
  436.           the range of 99..-99.  A value of zero (i.e. /N0) is invalid.
  437.  
  438. EXAMPLES
  439.      find date of Thanksgiving (4th Thursday in November) in 1992
  440.          FDATE /Fw /A11-01-1992 /Imm-dd-ccyy /D5 /N4 /Od1
  441.      returns: Thursday November 26, 1992
  442.  
  443.      find the beginning of the work-week (Monday, 2nd day of week)
  444.      AFTER Thanksgiving, 1992
  445.          FDATE /Fw /A11-26-1992 /Imm-dd-ccyy /D2 /N1 /Od1
  446.  
  447.      find the beginning of the work-week (Monday, 2nd day of week)
  448.      BEFORE Thanksgiving, 1992
  449.          FDATE /Fw /A11-26-1992 /Imm-dd-ccyy /D2 /N-1 /Od1
  450.  
  451.  
  452. MATH FUNCTIONS
  453. ==============
  454.  
  455. FUNCTION  FDATE /Ffunc /Anum  /Bnum
  456. --------  -------------------------------------------
  457.  
  458. #add      returns the sum of the integers specified
  459.           on the /A and /B parms.  Can be used to calculate the
  460.           "Julian" minute(second, date) in the future from a given
  461.           "Julian" minute(second, date).
  462.  
  463. #sub      (not supported)
  464.           no numeric subtraction operation (as such) is supported.
  465.           Often, you will find that #dif will do what you want.
  466.           #dif is the same as subtraction in which the smaller
  467.           number is subtracted from the larger number; it will never
  468.           return a negative number.  If you really MUST have
  469.           subtraction, which might return a negative result, you can
  470.           add two numbers, one of which is a negative number.
  471.           For example, to subtract 3 from 2:
  472.               FDATE /F#add /A2 /B-3          [ returns: -1 ]
  473.  
  474. #dif      returns the difference between the integers specified
  475.           on the /A and /B parms.  Can be used to calculate the
  476.           number of minutes(seconds, days) between two
  477.           "Julian"  minutes(seconds, dates).
  478.  
  479. #comp     compares the integers specified on the /A and /B parms.
  480.           returns         when
  481.             LT            /A  is less    than /B
  482.             EQ            /A  is equal   to   /B
  483.             GT            /A  is greater than /B
  484.  
  485.  
  486. PUTTING FDATE OUTPUT INTO AN ENVIRONMENT VARIABLE
  487. =================================================
  488.  
  489. FDATE's output is written to standard output, that is, it is displayed
  490. on the screen.  Output can be redirected to a file, or it can piped to
  491. a utility (such as STRINGS or GET) that will put it into an
  492. environment variable.
  493.  
  494. Manipulating the environment is an incredibly tricky business.  There
  495. are questions of the local versus master environment, the version of
  496. DOS you are running, and the environment under which you are running
  497. (DOS, Windows, Carousel).  In order to keep FDATE focussed on
  498. date-related issues, I have not attempted to make it put its output
  499. directly into an environment variable.
  500.  
  501. One way to put FDATE's output into an environment variable is to use
  502. the /P (prefix string) feature to create a DOS "SET" statement,
  503. redirect the output to a batch file, and CALL the batch file.
  504. Since CALL first appeared in DOS 3.3, you will need DOS 3.3 or
  505. greater to use this technique.
  506.  
  507.   FDATE /Ff /Atoday /O"mn zd, ccyy" /P"@SET FDATE=" >JUNKTEMP.BAT
  508.   call JUNKTEMP.BAT
  509.   del  JUNKTEMP.BAT
  510.  
  511. There are also shareware and public domain utilities that are written
  512. specifically to manipulate environment variables, and do that job very
  513. well.  FDATE's output can be put into an environment variable by piping
  514. it to one of these utilities.  When piping FDATE output to a utility,
  515. you can prevent the output from being ECHOed to the screen by
  516. redirecting the output to NUL.
  517.  
  518.    EXAMPLE: use STRINGS to put date into DATE1 environment variable
  519.    FDATE /Ff /At /Od1 | STRINGS date1= ASK >NUL
  520.  
  521.    -----------------------------------------------------------------
  522.    I recommend Bob Stephan's GET and PC Magazine's STRINGS.
  523.    As of December 30, 1991, the current version of GET is GET25.ZIP.
  524.    On CompuServe, use IBMFF to look for GET*.ZIP in CIS:IBMSYS
  525.    GET is also available from the Public Software Library in Houston.
  526.    On CompuServe, look for STRING.ZIP in Utilities Lib of ZNT:UTILFORUM
  527.    -----------------------------------------------------------------
  528.  
  529. =======================================================================
  530. EXAMPLE #1
  531. Redirect FDATE output to a file, or to a callable batch file,
  532. or pipe it to STRINGS or GET to store it in an environment variable
  533. =======================================================================
  534. rem display Fdate output on screen
  535. FDATE /Ff /At /Od1 /P"Today is "
  536.  
  537. rem Redirect FDATE output to a file
  538. FDATE /Ff /At /Od1 /P"Today is " >FDATE.OUT
  539.  
  540. rem Redirect FDATE output to a callable batch file
  541. FDATE /Ff /Atoday /O"mn zd, ccyy" /P"@SET DATE1=" >JUNKTEMP.BAT
  542. call JUNKTEMP.BAT
  543. del  JUNKTEMP.BAT
  544.  
  545. rem Pipe FDATE output to STRINGS to store it in DATE1 environment var
  546. FDATE /Ff /Atoday /O"mn zd, ccyy" |STRINGS date1= ASK >NUL
  547.  
  548. rem Pipe FDATE output to GET to store it in DATE1 environment var
  549. FDATE /Ff /Atoday /O"mn zd, ccyy" |GET ZE /Vdate1 >NUL
  550.  
  551.  
  552.  
  553. =======================================================================
  554. EXAMPLE #2
  555. Find the difference (in days) between two dates in different formats
  556. Use GET to put FDATE output into environment variables.
  557. =======================================================================
  558. set date1=05-10-1992
  559.  
  560. rem reformat date literal into same format as date1
  561. FDATE /Ff /Imm-dd-yy   /A05-08-92 /Omm-dd-ccyy | GET ZE /Vdate2>NUL
  562.  
  563. rem get difference between date1 and date2
  564. FDATE /Fdif /Imm-dd-ccyy /A%date1%  /B%date2%| GET ZE /vdiff>NUL
  565.  
  566. echo The difference is %diff% days.
  567.  
  568.  
  569.  
  570.  
  571. =======================================================================
  572. EXAMPLE #3
  573. Schedule a program to run at a specified time in the future.  Note that
  574. this involves a lot of disk activity because DOS re-reads the batch
  575. file from disk every time it does a GOTO LOOPTOP.  If you do this, it
  576. is a good idea to run the batch file from a RAM DISK.
  577. =======================================================================
  578. REM GET CURRENT JULIAN MINUTE AND PUT IN ENVIRONMENT VARIABLE RUNTIME
  579. FDATE /Ff /At /Ominute#  |STRINGS RunTime= ASK >NUL
  580.  
  581. REM ADD 120 MINUTES (2 HOURS) TO ENVIRONMENT VARIABLE RUNTIME
  582. FDATE /F#add /A%RunTime% /B120 |STRINGS RunTime= ASK >NUL
  583.  
  584. REM LOOP UNTIL NOWTIME HAS REACHED RUNTIME
  585. :LoopTop
  586.   FDATE /Ff /At  /Ominute#   |STRINGS NowTime=  ASK >NUL
  587.   FDATE /F#comp  /A%NowTime% /B%RunTime% |STRINGS TimeComp= ASK >NUL
  588.   if (%TimeComp%)==(LT) goto loopTOP
  589. :LoopEnd
  590.  
  591. echo STARTING EXECUTION OF APPLICATION: [program name]
  592.  
  593.  
  594.  
  595. =======================================================================
  596. EXAMPLE #4
  597. Rename file BACKUP.LOG to a name that contains today's date
  598. =======================================================================
  599. FDATE /Ff /Atoday /Oyymmdd /P"@SET DATE1=" >JUNKTEMP.BAT
  600. call JUNKTEMP.BAT
  601. del  JUNKTEMP.BAT
  602. ren  BACKUP.LOG  BK%DATE1%.LOG
  603. SET  DATE1=
  604.  
  605.  
  606.  
  607. =======================================================================
  608. EXAMPLE #4b
  609. Use FDATE to rename a log file to a name that will be unique within a
  610. minute time-frame.  This is a way to keep an historical record of a
  611. series of log files.  Since the file will retain its original date/time
  612. stamp, you will still be able easily to tell when it was created.
  613. In this example, we use GET to put the FDATE output into
  614. environment variable TEMPVAR.
  615. =======================================================================
  616. FDATE /FF /At /Ominute# | GET ZE /Vtempvar >nul
  617. REN online.log %tempvar%.log
  618. SET tempvar=
  619.  
  620.  
  621.  
  622. =======================================================================
  623. EXAMPLE #5
  624. Find the calendar date corresponding to Julian date 1992:200
  625. by adding 200 to the last day of the previous year.
  626. =======================================================================
  627. FDATE /Fadd /A12-31-1991 /Imm-dd-ccyy /N200 /Od1
  628.  
  629.  
  630.  
  631. =======================================================================
  632. EXAMPLE #6
  633. Check to see if parameter %1 is a valid year (CCYY)
  634. =======================================================================
  635. @echo off
  636. rem determine if value sent in through parameter %1 is a valid year
  637. Fdate /Ff /Imm-dd-ccyy /A01-01-%1 /Od1 >nul
  638. if errorlevel 1 echo Parm 1 was not a valid year: %1
  639. if errorlevel 1 goto endit
  640.  
  641. echo PUT YOUR BATCH PROCESSING HERE, USING YEAR VALUE OF: %1
  642.  
  643. :endit
  644.  
  645.  
  646.  
  647. =======================================================================
  648. EXAMPLE #7
  649. Find the 4th Thursday in November (Thanksgiving)
  650. =======================================================================
  651. Fdate /Fw /D5 /N4 /A11-01-%year% /Imm-dd-ccyy /Od1 /P"Thanksgiving: "
  652.  
  653.  
  654.  
  655. =======================================================================
  656. EXAMPLE #8
  657. Show the number of the anniversary for some special event.
  658. =======================================================================
  659. SEE HOLIDAYS.BAT
  660.  
  661.  
  662. =======================================================================
  663. EXAMPLE #9
  664. Run a program once a day, when you boot for the first time that day.
  665. =======================================================================
  666. @echo off
  667. cls
  668.  
  669. REM -------------------------------------------------------------------
  670. REM Run daily processing once a day.  Put this code in AUTOEXEC.BAT.
  671. REM This batch file requires DOS 3.3+, since it uses CALL.
  672. REM -------------------------------------------------------------------
  673. if not exist LastRun.BAT goto RunNow
  674. REM LastRun.Bat will set env var LASTRUN to date AUTOEXEC was last run.
  675. call LastRun.BAT
  676.  
  677. REM Compare today's date to date in LASTRUN
  678. Fdate /Fcomp /Imm-dd-ccyy /At /B%LastRun% /P"@set COMP=">junktemp.BAT
  679. call junktemp.BAT
  680. del  junktemp.BAT
  681.  
  682. IF (%COMP%)==(EQ) goto NoRun
  683. REM if user reset system clock, today's date may be less than LASTRUN
  684. IF (%COMP%)==(LT) goto NoRun
  685.  
  686. rem Daily processing hasn't been run today. Run it.
  687.  
  688. echo RUNNING ONCE A DAY PROCESSING: Job 1
  689. echo RUNNING ONCE A DAY PROCESSING: Job 2
  690. echo RUNNING ONCE A DAY PROCESSING: ............. etc.
  691.  
  692. rem ------------------------------------------------------------------
  693. rem Save today's date in a new version of LastRun.BAT
  694. rem Note that this will be executed only if daily processing runs to
  695. rem completion without hanging the machine or aborting the batch file.
  696. rem ------------------------------------------------------------------
  697. Fdate /Ff /Omm-dd-ccyy /At /P"@set LastRun=">LastRun.BAT
  698.  
  699. :NoRun
  700. set LastRun=
  701. set COMP=
  702.  
  703. FDATE'S ALGORITHMS
  704. ==================
  705.  
  706.  
  707. FDATE IS DESIGNED FOR BUSINESS, NOT HISTORICAL, APPLICATIONS
  708. ============================================================
  709. FDATE is intended for business applications, not historical ones.
  710. As far as FDATE is concerned, the calendar has followed the same
  711. pattern, unchanged, since January 1, 0001.
  712.     -------------------------------------------------------------------
  713.     FDATE does not take into account historical changes in the calendar
  714.     such as the glitch in English dates that occurred when Britain
  715.     moved from the Julian to Gregorian calendar in the 18th century,
  716.     or Russia made the same move in the early 20th century.
  717.     -------------------------------------------------------------------
  718.  
  719.  
  720. FDATE'S BASE DATE
  721. =================
  722.   Internally, date manipulations are based on translating a calendar
  723.   date into an "absolute" or "TRUE Julian" date:  a date expressed
  724.   as the number of days from some day in the distant past.
  725.   FDATE's base date is January 1, 0001 (i.e. day 1 of month 1 of year 1)
  726.   FDATE's absolute date for January 1, 0001 is      1.
  727.   FDATE's absolute date for January 1, 1992 is 727198.
  728.  
  729.  
  730. FDATE'S LEAP YEAR ALGORITHM
  731. ===========================
  732.     Every year evenly divisible by 4 IS a leap year
  733.       EXCEPT THAT
  734.         Every year evenly divisible by 100 IS NOT a leap year
  735.           EXCEPT THAT
  736.             Every year evenly divisible by 400 IS a leap year
  737.     .
  738.     Using this algorithm
  739.          1983  is not a leap year
  740.          1984  is     a leap year
  741.          1900  is not a leap year
  742.          2000  is     a leap year
  743.  
  744.     See "A Machine Algorithm for Processing Calendar Dates", by
  745.          Henry F. Fliegel (Georgetown University Observatory) and
  746.          Thomas C. Van Flandern (U.S. Naval Observatory)
  747.          COMMUNICATIONS OF THE ACM, Volume 11, Number 10, October 1968
  748.  
  749. There is supposedly a new adjustment to the leapyear algorithm,
  750. which specifies the additional exception:
  751.  
  752.               EXCEPT THAT
  753.                 Every year evenly divisible by 4000 IS a leap year
  754.  
  755. See "Bit By Bit" column, COMPUTER LANGUAGE, November 1989, p. 148.
  756. This adjustment is not part of FDATE's leapyear algorithm.
  757. Unless your application is working with dates 2,000 years in the
  758. future, the lack of this exception will be irrelevant for you.
  759.  
  760. DEMONSTRATION BATCH FILES
  761. =========================
  762.    FDATE ships with a number of demonstration batch files.  These are
  763.    sample applications that illustrate some of the ways that FDATE
  764.    might be used to build applications.  They can be studied for
  765.    ideas for ways of using FDATE.  They can also be used "as is", or
  766.    copied and customized to build applications that meet your own
  767.    special needs.
  768.  
  769.  
  770.  
  771.  
  772.  
  773. DEMONSTRATION BATCH FILE: HOLIDAYS.BAT
  774. ======================================
  775.  
  776. HOLIDAYS without any parameters displays events in current year.
  777. HOLIDAYS with a year parameter  displays events in that    year.
  778.  
  779.    EXAMPLE: HOLIDAYS               displays events in current year
  780.    EXAMPLE: HOLIDAYS 1999          displays events in year 1999.
  781.  
  782. As the holidays are displayed, you can dump each screen display
  783. to a printer by pressing SHIFT+PRINTSCREEN.
  784.  
  785.  
  786.  
  787. DEMONSTRATION BATCH FILE: ALARM
  788. ===============================
  789. ALARM.BAT is like a simple alarm clock for your PC.  ALARM.BAT waits
  790. until a specified time, then triggers an alarm: it beeps and displays a
  791. message.  It continues until someone presses CONTROL-BREAK.
  792.  
  793. If you enter just "ALARM" at the DOS prompt, without any parameters,
  794. ALARM displays a HELP screen that shows how to use it.
  795.  
  796. ALARM uses ANSI control codes to control screen color and cursor
  797. placement, so it requires ANSI.SYS in order to work properly.
  798. If you are not using ANSI.SYS, it will display some garbage
  799. characters on your screen unless you modify the batch file to remove
  800. the ANSI control codes.
  801.  
  802.  USAGE   : ALARM                      shows current time in hhmm format
  803.  USAGE   : ALARM hhmm [msg]           waits until hhmm, then sounds an alarm
  804.  
  805.  EXAMPLE : ALARM 0930                 [sounds alarm at 9:30 am]
  806.  EXAMPLE : ALARM 930 Staff meeting    [sounds alarm at 9:30 am]
  807.  EXAMPLE : ALARM 1800                 [sounds alarm at 6:00 pm]
  808.  
  809.            For midnight, specify 0000 or 2400 for hhmm.
  810.  EXAMPLE : ALARM 2400  START MIDNIGHT BATCH RUN
  811.  
  812. The first thing that ALARM.BAT does is to change to the M: drive.  M:
  813. is presumed to be a RAM disk.   Before you can use ALARM.BAT, you
  814. should use your favorite text editor to change the RAM disk designation
  815. to point to your own RAM disk.  It is possible to run ALARM.BAT from a
  816. normal hard disk or floppy, but because ALARM.BAT does a LOT of disk
  817. activity, it is strongly recommended that you make your current
  818. directory a RAM disk before running it.
  819.  
  820. To prevent repeated disk accesses to find the FDATE program, you
  821. should also have FDATE on the RAM disk, or be using a cache.
  822.  
  823. USING ALARM TO CREATE RUN-IT
  824. ============================
  825.  
  826. You can copy ALARM.BAT to another batch file (say, RUN-IT.BAT) and
  827. modify it so that rather than sounding an alarm it triggers other
  828. activiites instead: runs a program or programs, or chains to another
  829. batch file, for example.
  830.  
  831. To create a generalized RUN-IT.BAT, you could use the words of the
  832. message to pass in the name of a batch file that you want to be run at
  833. a certain time, along with its parameters.  Make the triggered activity
  834. this:
  835.  
  836.     rem Note that earlier SHIFT has moved batch file name to parm 1.
  837.     rem run %1 batch file.
  838.     %1 %2 %3 %4 %5 %6 %7 %8 %9
  839.  
  840. Then entering this at the DOS prompt:
  841.  
  842.     RUN-IT 0001 BACKUP.BAT C: D: E:
  843.  
  844. would cause RUN-IT to wait until 1 minute past midnight, then
  845. run a batch file called BACKUP.BAT to backup drives C:, D:, and E:.
  846.  
  847.  
  848. DEMONSTRATION BATCH FILE: TIC.BAT
  849. =================================
  850.  
  851. TIC.BAT is a sample application that uses FDATE to create a "tickler
  852. file" batch file.  The default name for the file is C:\TICKLER.BAT.
  853.  
  854. In order to use TIC on a regular basis, you should:
  855.  
  856.    * Use your favorite text editor to modify TIC.BAT so that it
  857.      will use your favorite text editor in the EDIT function.
  858.      (TIC.BAT ships with the editor set to SPFPC).
  859.  
  860.    * If you wish, use your favorite text editor to modify the
  861.      first few lines of TIC.BAT, so the "SET TicBAT=" statement
  862.      sets TicBAT to a different file name for the tickler batch file.
  863.      Note that you must specify the full filename,
  864.      including path and extension.
  865.  
  866.    * Put TIC.BAT in a directory that is in your PATH.
  867.  
  868.    * add the following lines to your AUTOEXEC.BAT file:
  869.  
  870.          CLS
  871.          rem show today's appointments
  872.          call TIC T
  873.          echo.
  874.  
  875.          rem show tomorrow's appointments [note space betwee T and +1]
  876.          call TIC T +1
  877.          echo.
  878.  
  879.          pause
  880.  
  881.      This will cause the tickler batch file to be run when you
  882.      boot your computer, showing you your scheduled appointments.
  883.  
  884. HELP
  885. ====
  886. Running TIC without any parms will cause it to display a HELP screen.
  887.   EXAMPLE: tic
  888.  
  889.  
  890. ADDING A NEW TICKLE (SINGLE DATES)
  891. ==================================
  892. To add a new SINGLE DATE tickle, invoke TIC.  The first parm must be the
  893. date of the desired tickle, in the format mm/dd/yy.  (You may use the
  894. pseudodate TT for the current month or year, if you wish.)
  895.  
  896. This parm must be followed by a description of the appointment.
  897.   * If no description is entered, TIC interprets the date in parm 1
  898.     as a request to display the tickles for that date.
  899. NOTE: DOS batch files strip commas out of their input parameters, so
  900. any commas in your description will be lost.
  901.  
  902.   EXAMPLE: tic 5/5/92 Cinco de Mayo party w/ Susan: El Charro @ 6pm
  903.   EXAMPLE: tic 5/5/tt Cinco de Mayo party w/ Susan: El Charro @ 6pm
  904.  
  905.  
  906. ADDING A NEW TICKLE (REGULAR WEEKLY APPOINTMENTS)
  907. =================================================
  908. To add a new REGULAR APPOINTMENT tickle, invoke TIC.  The first two
  909. parms must be the string "dow" (or "DOW") and the day-of-the-week
  910. number of the day of the week (e.g. 2 for Monday).
  911.  
  912. These parms should be followed by a description of the appointment.
  913.  
  914.   EXAMPLE: tic dow 2 Regular Monday morning staff meeting @ 8:30 am
  915.   EXAMPLE: TIC DOW 6 STANDING TENNIS DATE WITH JANICE AT 6:30
  916.  
  917.  
  918. CHECKING YOUR TICKLES
  919. =====================
  920. You can check your tickler file appointments for a particular day at
  921. any time by invoking TIC with only a date parm or the pseudodate T or
  922. TODAY.
  923.  
  924.   EXAMPLE: tic t         displays appointments for today
  925.   EXAMPLE: tic today     displays appointments for today
  926.   EXAMPLE: tic 5/5/92    displays appointments for May 5, 1992
  927.   EXAMPLE: tic 5/5/tt    displays appointments for May 5 of this year
  928.   EXAMPLE: tic tt/5/tt   displays appointments for the 5th of this month
  929.  
  930. You can check your tickler file appointments for a date from one to
  931. seven days in the future by invoking TIC with two parms: T (for today)
  932. followed by a number of +1 through +7.  Unsigned numbers are treated
  933. as if they have a plus sign.  Negative numbers will show appointments
  934. for days in the past.
  935.  
  936.   EXAMPLE: tic t      displays appointments for today
  937.   EXAMPLE: tic t  1   displays appointments for tomorrow
  938.   EXAMPLE: tic t +1   displays appointments for tomorrow
  939.   EXAMPLE: tic t +7   displays appointments for a week from today
  940.   EXAMPLE: tic t -1   displays appointments for yesterday
  941.  
  942. Note that the space between the first parm "T" and the second, number
  943. parm, is required:
  944.  
  945.   EXAMPLE: tic t+2    does not recognise "t+2" as "t +2".
  946.                       Displays appointments for TODAY.
  947.  
  948. If the tickler batch file does not exist, nothing will be displayed.
  949.  
  950. REMOVING DEAD TICKLES
  951. =====================
  952. After a while the tickler batch file will become very long, filled with
  953. "dead tickles".  You can edit it with a text editor to remove the dead
  954. tickles:
  955.  
  956.   EXAMPLE: tic edit
  957.   EXAMPLE: TIC ED
  958.  
  959. or simply delete it and let TIC create a new one the next time
  960. you use TIC to add a tickle.
  961.  
  962. USE AND DISTRIBUTION OF FDATE
  963. =============================
  964.  
  965. FDATE is freeware, or what is known as "zero-cost shareware".
  966. FDATE is not what is technically called "public domain" software
  967. because the author retains the copyright.  FDATE can, however,
  968. be copied, used, and distributed freely as long as both FDATE.EXE
  969. and its associated doc file (FDATE.DOC) and its demonstration batch
  970. files (FDATEX.BAT, HOLIDAYS.BAT, TIC.BAT, ALARM.BAT) are not altered
  971. and are distributed together.
  972.  
  973. FDATE can be included in shareware packages as long as both FDATE and
  974. its related files are included in the shareware package.
  975.  
  976. If you have received FDATE as part of some larger shareware package,
  977. please be aware that you may freely use, copy, and distribute FDATE
  978. without paying a fee for, or registering, the larger package.
  979.  
  980. The author explicitly disavows any claim whatsoever about the
  981. correctness or functionality of FDATE, its documentation, and its
  982. demonstration batch files, and disclaims liability for anything and
  983. everything bad that might happen in connection with, before, during, or
  984. after using it.  I have tried to make FDATE work right, but everybody
  985. makes mistakes, so you use FDATE at your own risk.
  986.  
  987. I don't know if people will find FDATE useful, and I'd like to find
  988. out.  If you find FDATE useful and use it on a regular basis, I'd
  989. appreciate it if you would drop me a short note via US mail or
  990. CompuServe, telling me about how you are using FDATE.
  991.  
  992. If you need other input/output formats, or if you need a different
  993. leapyear algorithm, please contact the author.
  994.  
  995.  
  996.  
  997.  
  998. UPDATES AND CURRENT VERSION OF FDATE
  999. ====================================
  1000.  
  1001. You will always be able to find the most recent version of FDATE on
  1002. CompuServe.  The filename will be FDATE.ZIP, and it will be available in
  1003. one of the libraries in the CIS:IBMSYS forum and one of the libraries in
  1004. the ZNT:UTILFORUM forum.  You can find it by using cross-library
  1005. searching, looking for the filename FDATE.ZIP or the keyword FDATE.
  1006.  
  1007. Feel free to post copies of FDATE.ZIP on any BBS that you wish, but
  1008. please do not upload it to any CompuServe library.  As long as I am the
  1009. only one putting copies of FDATE onto CompuServe, we can keep confusion
  1010. over versions to a minimum.
  1011.  
  1012. The current distribution package (FDATE.ZIP) contains the following:
  1013.  
  1014.        FDATE.EXE         [the FDATE program]
  1015.        FDATE.DOC         [this file, documentation for FDATE]
  1016.  
  1017.        FDATEX.BAT        [demonstration batch files]
  1018.        HOLIDAYS.BAT
  1019.        TIC.BAT
  1020.  
  1021.  
  1022. FDATE REVISION HISTORY
  1023. ======================
  1024.  
  1025. Letters appended to version numbers indicate modifications to
  1026. the doc files, without any modification to the FDATE.EXE software.
  1027. Asterisks (*) indicate most important changes in the new version.
  1028.  
  1029. 1.1   Oct 01, 1991
  1030.       First version of FDATE
  1031.  
  1032. 1.2   Oct 15, 1991
  1033.       Replaced shareware date routines with Ferg routines
  1034.       NOTE THAT THERE IS NOT MUCH ERROR-CHECKING IN THIS VERSION.
  1035.  
  1036. 1.2d  Oct 16, 1991
  1037.       Minor changes to show redirection and piping of FDATE output
  1038.       Revised discussion of how FDATE may be distributed.
  1039.       Added note on business-related, non-historical purpose of FDATE
  1040.       Added note on 4000-year leap-year exception
  1041.  
  1042. 1.2e  Oct 17, 1991
  1043.       Added note on why FDATE doesn't directly set an Env variable
  1044.  
  1045. 2.0a  Nov 05, 1991
  1046.       Modified Help display to show parameters and their meanings
  1047.       Added output format YYMMDD
  1048.       Added output format minute# and second#
  1049.       Added function #dif
  1050.       Added test of GET and STRINGS      to FDATEX.BAT
  1051.       Added test of minute# and second#  to FDATEX.BAT
  1052.  
  1053. 2.1a  Nov 06, 1991
  1054.       Added /P parameter and modified documentation accordingly
  1055.       Added JULDATE output format
  1056.       Minor changes and reformatting to documenation
  1057.  
  1058. 2.2a  Nov 08, 1991
  1059.       Added example showing how to put current date in a filename
  1060.       Added MMDD output formats
  1061.  
  1062. 2.3a  Nov 09, 1991
  1063.       Added /L (language parameter) to allow French-language output
  1064.       Added the following output formats
  1065.          full
  1066.          "mn3 zd, ccyy"
  1067.          "zd mn, ccyy"
  1068.          "zd mn ccyy"
  1069.          European-style date formats
  1070.                in which day occurs before month (e.g. dd/mm/ccyy)
  1071.  
  1072. 2.4a  Nov 10, 1991
  1073.       Fixed display of time in /Ofull so that a minutes value of
  1074.             less than 10 would display with a leading zero:
  1075.             e.g. "10:08 am" instead of "10:8 am".
  1076.  
  1077. 2.5a  Nov 13, 1991
  1078.       Added output format CCYYMM
  1079.  
  1080. 2.6a  Nov 25, 1991
  1081.       Added function "F" (/Ff) as an synonym for /Fformat
  1082.       Split FDATEX.BAT off from FDATE.DOC into its own file
  1083.  
  1084. 2.6b  Dec 02, 1991
  1085.       Modified this doc file to reflect new /Ff feature
  1086.  
  1087. 2.7a  Dec 07, 1991
  1088.       Added CompuServe-style output format: dd-mn3-yy.
  1089.                                    Example: 07-Dec-91
  1090.  
  1091. 2.8a  Dec 08, 1991
  1092.       Added output format d1.    Example:  Saturday December 7, 1991
  1093.       Added output format t1.    Example:  9:05 am
  1094.       Added "t" alias for "today" pseudodate.
  1095.  
  1096.       Corrected FDATE "help" display which had incorrectly shown
  1097.          dd-mn3-yy as an input (rather than an output) format.
  1098.       Modified documentation and FDATEX.BAT to reflect software changes.
  1099.       Extensively re-wrote and re-arranged FDATEX.BAT to make it
  1100.          more user-friendly.
  1101.       In documentation:
  1102.          corrected the formats for European dates, which had incorrectly
  1103.          been shown as having the same format as American dates.
  1104.  
  1105. 2.8b  Dec 09, 1991
  1106.       In documentation:
  1107.          Added example showing how to use fdate to create a
  1108.          time-stamped filename.
  1109.  
  1110. 2.9a  Dec 26, 1991
  1111.       Added STRINGS and GET info to HELP screen.
  1112.       In documentation:
  1113.          Added example: how to find calendar date of Julian date
  1114.  
  1115. 3.0a  Dec 27, 1991
  1116. *     =============== MAJOR BUG FIX ==============================
  1117. *     Fixed bug in TRUEDATE date arithmetic routine that caused
  1118. *     incorrect dates to be returned for the last 2 or 3 days of
  1119. *     some months.
  1120. *     ============================================================
  1121.       Added output formats ccyy, hh:mm, and hh:mm:ss.
  1122.       Replaced output format JULDATE with JULIAN
  1123.              JULDATE retained for compatibility, but not documented.
  1124.       Modified this doc file and FDATEX.BAT accordingly.
  1125.  
  1126. 3.1a  Dec 28, 1991
  1127.       Fixed bug: error messages were ignoring the /P parm
  1128.       added HOLIDAYS.BAT to distribution package
  1129.       Replaced output format LEAPYR with LY
  1130.              LEAPYR retained for compatibility, but not documented.
  1131.       Added new feature: when an error is detected:
  1132.              output string is "ERROR", and
  1133.              errorlevel is set to 1.
  1134.       Changed assumed century on input formats that require only YY.
  1135.              Now, if year is LT/EQ 20, a century of 20 is assumed.
  1136.              FDATE will now be able to function nicely until year 2020.
  1137.       Modified this doc file and FDATEX.BAT accordingly.
  1138.  
  1139. 3.2a  Dec 29, 1991
  1140.       Added COMP (date compare) function
  1141.       Added RUN-ONCE-A-DAY example, which uses new COMP function
  1142.       Added error-trapping for dates before year 1 and after year 9999.
  1143.       Fixed minor error in HELP screen (dif does NOT require /O).
  1144.       Modified this doc file and FDATEX.BAT accordingly.
  1145.  
  1146. 3.2b  Dec 30, 1991
  1147.       Fixed two bugs in this doc file. (Thanks to Luther Schliesser
  1148.          for the bug report.)   My phone number was wrong, and the
  1149.          values returned by the leapyear function (0,1) were reversed.
  1150.       Fixed my phone number in the HELP screen.
  1151.       Minor changes in the examples in this DOC file.
  1152.  
  1153. 3.2c  Dec 31, 1991
  1154.       Fixed bug in HOLIDAYS.BAT that showed New Year's Eve when
  1155.             it should have showed New Year's Day.
  1156.             (Thanks to Luther Schliesser for ANOTHER bug report.)
  1157.       Modified HOLIDAYS.BAT to show Easter-related holidays 1992-2000
  1158.       Modified HOLIDAYS.BAT to give an example of calculating
  1159.           anniversaries for a user-specified "special date" (SD)
  1160.  
  1161. 4.1a  Jan 03, 1992
  1162. *     Added ability to accept TT, TT, and TTTT
  1163.             as pseudodates for current MM, DD, and CCYY.
  1164. *     Added function: W  (i.e. /Fw)
  1165.       Modified this doc file, FDATEX.BAT, and HOLIDAYS.BAT accordingly.
  1166.  
  1167.       Modified HOLIDAYS.BAT to use new /Fw to show Thanksgiving.
  1168.       Added Luther Schliesser's anniversary code to HOLIDAYS.BAT
  1169.       Added note on elimination of multiple spaces from /P strings.
  1170.       Added note showing how to use #add and negative number to do
  1171.             true subtraction.
  1172.       Added note: UPDATES AND CURRENT VERSION OF FDATE
  1173.  
  1174. 4.2a  Jan 04, 1992
  1175.       In FDATE.EXE:
  1176.       Minor change to improve readability of an error message
  1177.  
  1178.       In FDATE.DOC:
  1179. *     expanded discussion of how to check for errors using FDATE
  1180.       added documentation for TIC.BAT
  1181.  
  1182.       In HOLIDAYS.BAT:
  1183.       added Easter days for 1991 and 2001, Epiphany, Pentecost, etc.
  1184.       fixed bug in algorithm for Ash Wednesday (thanks to L. Schliesser)
  1185.       changed "Memorial Day"            , May 30
  1186.            to "Memorial Day (observed)" , the last Monday in May
  1187.       inspired by L.S.'s tickler for Sharon's birthday, added "tickler"
  1188.            for 500th anniversary of Columbus' discovery of America
  1189.  
  1190.       Added TIC.BAT to FDATE distribution ZIP file
  1191.       Started practice of highlighting important changes with "*"
  1192.  
  1193. 4.2b  Jan 06, 1992
  1194.       In HOLIDAYS.BAT:
  1195.          Corrected algorithm for Advent (thanks to L. Schliesser)
  1196.          Advent is the 4 Sundays BEFORE, but NOT including, Christmas.
  1197.          (The error would not make any difference before 1994)
  1198.  
  1199. 4.2c  Jan 07, 1992
  1200.       In HOLIDAYS.BAT:
  1201.          Added LABOR DAY (thanks to L.S.)
  1202.       In TIC.BAT
  1203. *        Added ability to add regular day-of-week appointments
  1204. *        Added EDIT function to make it easy to edit TICKLER.BAT
  1205.          Removed 18-word limit on appointment descriptions
  1206.          Added ANSI.SYS codes to make help screen show in color
  1207.  
  1208. 4.3a  Jan 12, 1992
  1209. *     Added defaults for: /Adate,  /Bdate,  /I and         /O
  1210.             defaults are: /Atoday, /Btoday, /Imm-dd-ccyy , /Od1
  1211. *     Added British-style output format, e.g. 1.15.1992 (Jan 15, 1992)
  1212. *     Added output formats: dd, zd, hhmm, hhmmss
  1213.  
  1214.       Added ability to process +1..+5 to TIC.BAT
  1215.       added ALARM.BAT to FDATE distribution package
  1216.  
  1217. 4.4a  Jan 20, 1992
  1218. *     Added /S, suffix string parameter
  1219.       modified CMDLIN unit to handle empty parms (e.g. /A ) better
  1220.       Added Black History Month to HOLIDAYS.BAT to demonstrate /S
  1221.  
  1222.